//-------------------------------------------------------------------------
/**
File:   BackBuffer.h

Descr.: 

Author: Stefan Leihkauf
Date:   21.02.2014
*/
//-------------------------------------------------------------------------
#ifndef _BACKBUFFER_H
#define _BACKBUFFER_H
#include "common/types/typedef.h"

namespace cb { namespace unsorted {

    enum ColorFormat
    {
        FMT_Unknown = 0,
        FMT_RGB565,
        FMT_RGB888
    };

    uint PixelsizeFromFormat(ColorFormat fmt);

    class BackBuffer
    {
        uint m_Width, m_Height;
        ColorFormat m_Format;
        uint m_Stride;
        uint m_Pixelsize;

    public:
        /// construction
        BackBuffer();
        ~BackBuffer();

        // get width
        uint Width() const { return m_Width; }
        // get height
        uint Height() const { return m_Height; }
        // get stride 
        uint Stride() const { return (m_Width * PixelsizeFromFormat(m_Format)); }
        // get size of pixel
        uint Pixelsize() const { return m_Pixelsize; }
        // get color format
        ColorFormat Format() const { return m_Format; }
    };


}} // cb::unsorted

#endif //! _BACKBUFFER_H